package PCClient2;

import java.net.DatagramPacket;
import java.net.DatagramSocket;

/**
 * @Author: 0162977
 * @Date: 2020/12/2 15:53
 */
public class ListenThread implements Runnable{

    DatagramSocket socket = null;
    DatagramPacket packet = null;

    public ListenThread(DatagramSocket socket,DatagramPacket packet) {
        this.socket = socket;
        this.packet = packet;
    }

    @Override
    public void run() {
        String info = null;
        info = new String(packet.getData(), 0, packet.getLength());

        System.out.println(info);
        ShareSpaceAndFun.checkResult(info.split(",")[0],info.split(",")[1]);
//        ShareSpaceAndFun.success();

    }

}
